/**
 * author:Administrator
 * date:2016/1/5
 * desc:TODO
 */

var Sequelize = require('sequelize');
var cfg = require('../config/index.js');
var cfgMysql = cfg.mysql;

//var uri = 'mysql://%user:%pwd@%host:%port/%dbName'
//  .replace('%user', cfg.mysql.user)
//  .replace('%pwd', cfg.mysql.password)
//  .replace('%host', cfg.mysql.host)
//  .replace('%port', cfg.mysql.port + '')
//  .replace('%dbName', cfg.mysql.dbName);

var seq = new Sequelize(
  cfg.mysql.dbName,
  cfg.mysql.user,
  cfg.mysql.password,
  {
    host: cfg.mysql.host,
    port: cfg.mysql.port
  }
);

module.exports = seq;